package com.xinqing.bigdata.rdd

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
  * @Author:CHQ
  * @Date:2020 /6/19 17:49
  * @Description
  */
object CreateRDD {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[*]").setAppName("create RDD")
    val sc = new SparkContext(conf)
    val listRDD = sc.makeRDD(List(1, 2, 3), 8)
    val pRDD: RDD[Int] = sc.parallelize(List(1, 2, 3))
    pRDD.saveAsTextFile("output")
    // pRDD.foreach(print)
  }
}
